var tdKey = '4086e32774bba771f0c76308b759105f'
var TiandiMap_vec = new ol.layer.Tile({
  title: '天地图矢量图层',
  source: new ol.source.XYZ({
    url:
      'http://t0.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=' + tdKey, //parent.TiandituKey()为天地图密钥,
    wrapX: false,
    //解决导出图片
    crossOrigin: 'Anonymous',
  }),
})
var TiandiMap_cva = new ol.layer.Tile({
  title: '天地图矢量注记图层',
  source: new ol.source.XYZ({
    url:
      'http://t0.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=' + tdKey, //parent.TiandituKey()为天地图密钥
    wrapX: false,
    //解决导出图片
    crossOrigin: 'Anonymous',
  }),
})
// 天地图影像图层
var TiandiMap_img = new ol.layer.Tile({
  title: '天地图影像图层',
  source: new ol.source.XYZ({
    url:
      'http://t0.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=' + tdKey,
    wrapX: false,
    crossOrigin: 'Anonymous',
  }),
})
// 天地图影像注记图层
var TiandiMap_cia = new ol.layer.Tile({
  title: '天地图影像注记图层',
  source: new ol.source.XYZ({
    url:
      'http://t0.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=' + tdKey,
    wrapX: false,
    crossOrigin: 'Anonymous',
  }),
})

var docLayer = new Zondy.Map.Doc('', 'guanggu', {
  ip: 'localhost',
  port: 6163,
  crossOrigin: 'Anonymous',
})
var map = new ol.Map({
  layers: [
    TiandiMap_img,
    TiandiMap_cia,
    TiandiMap_vec,
    TiandiMap_cva,
    docLayer,
  ],
  view: new ol.View({
    projection: 'EPSG:4326',
    center: [114.383, 30.49],
    zoom: 13.2,
  }),
})

export {
  TiandiMap_vec,
  TiandiMap_cva,
  TiandiMap_img,
  TiandiMap_cia,
  docLayer,
  map,
}
